package com.sn.shop.service.impl;

import com.sn.shop.dao.UserMapper;
import com.sn.shop.model.User;
import com.sn.shop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @auther sn
 * @date 2018/2/8
 * @description TODO
 */
@Service
public class UserServiceImpl implements UserService{
    
    @Autowired
    UserMapper userMapper;

    public User findById(int id) {
        return userMapper.selectById(id);
    }

    public int changePassword(String newPwd) {
        return userMapper.changePassword(newPwd);
    }

    public User findByName(String name) {
        return userMapper.selectByName(name);
    }
}
